package com.zhss.eshop.inventory.async;

import java.util.List;

/**
 * 离线存储管理组件接口
 * @author suyuan
 *
 */
public interface OfflineStorageManager {

	/**
	 * 离线存储库存更新消息
	 * @param message 库存更新消息
	 * @throws Exception
	 */
	void store(StockUpdateMessage message) throws Exception;

	/**
	 * 获取离线存储标识
	 * @return 离线存储标识
	 * @throws Exception
	 */
	Boolean getOffline() throws Exception;

	/**
	 * 设置离线存储标识
	 * @param offline 离线存储标识
	 * @throws Exception
	 */
	void setOffline(Boolean offline) throws Exception;

	/**
	 * 批量删除库存更新消息
	 * @param stockUpdateMessages 库存更新消息
	 * @throws Exception
	 */
	void removeByBatch(List<StockUpdateMessage> stockUpdateMessages) throws Exception;

	/**
	 * 判断是否还有下一批库存更新消息
	 * @return 是否还有下一批库存更新消息
	 * @throws Exception
	 */
//	 Boolean hasNext() throws Exception;

	/**
	 * 获取下一批库存更新消息
	 * @return 下一批库存更新消息
	 * @throws Exception
	 */
//	List<StockUpdateMessage> next() throws Exception;

	/**
	 * 获取迭代器
	 * @return 迭代器
	 * @throws Exception
	 */
	OfflineStorageIterator iterator() throws Exception;

}
